package cn.edu.cug.cs.gtl.plugins.redner4oi;

import cn.edu.cug.cs.gtl.apis.render.nodes.Selection;
import cn.edu.cug.cs.gtl.apis.render.paths.Path;
import cn.edu.cug.cs.gtl.plugins.redner4oi.nodes.GradientBackgroundImpl;
import cn.edu.cug.cs.gtl.plugins.redner4oi.nodes.GroupImpl;
import cn.edu.cug.cs.gtl.plugins.redner4oi.nodes.SeparatorImpl;
import cn.edu.cug.cs.gtl.protos.Point3D;
import cn.edu.cug.cs.gtl.protos.Vertex3d;
import cn.edu.cug.cs.gtl.apis.render.Factory;
import cn.edu.cug.cs.gtl.apis.render.Render;
import cn.edu.cug.cs.gtl.apis.render.Tune;
import cn.edu.cug.cs.gtl.apis.render.nodes.GradientBackground;
import cn.edu.cug.cs.gtl.apis.render.nodes.Group;
import cn.edu.cug.cs.gtl.apis.render.nodes.Separator;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class Render4OIPlugin extends Plugin {
    /**
     * Constructor to be used by plugin manager for plugin instantiation.
     * Your plugins have to provide constructor with this exact signature to
     * be successfully loaded by manager.
     *
     * @param wrapper
     * @deprecated Use application custom {@code PluginContext} instead of {@code PluginWrapper}.
     * See demo for more details.
     */
    public Render4OIPlugin(PluginWrapper wrapper) {
        super(wrapper);
    }

    public Render4OIPlugin() {
    }

    /**
     * This method is called by the application when the plugin is started.
     */
    @Override
    public void start() {
        super.start();
    }

    /**
     * This method is called by the application when the plugin is stopped.
     */
    @Override
    public void stop() {
        super.stop();
    }

    /**
     * This method is called by the application when the plugin is deleted.
     */
    @Override
    public void delete() {
        super.delete();
    }

    @Extension
    public static class FactoryImpl implements Factory {
        @Override
        public Render createRender() {
            return new RenderImpl();
        }

        @Override
        public Separator createSeparator() {
            return new SeparatorImpl();
        }

        @Override
        public Tune createTune() {
            return new TuneImpl();
        }

        @Override
        public GradientBackground createGradientBackground() {
            return new GradientBackgroundImpl();
        }

        @Override
        public Group createGroup() {
            return new GroupImpl();
        }

        @Override
        public Point3D createPoint3D(double x, double y, double z) {
            return Point3D.newBuilder().setLocation(Vertex3d.newBuilder().setX(x).setY(y).setZ(z).build()).build();
        }

        @Override
        public Path createPath() {
            return null;
        }

        @Override
        public Selection createSelection() {
            return null;
        }


    }
}
